import http from 'utilMethods/http'

const request = 'http://report.wsn2019.club/year'

const year = {
  // 年报
  // 填写年报
  postAddYearReport(params) {
    return http.post(`${request}/addYearReport`, params)
  },
  // 修改年报
  postUpdateYearReport(params) {
    return http.post(`${request}/updateYearReport`, params)
  },
  // 查看某人某年年报
  getPersonYearReport(params) {
    return http.get(`${request}/getYearReport`, params)
  },
  // 查看某组某年年报
  getYearReportByGroup(params) {
    return http.get(`${request}/get/groupYearReport`, params)
  },

  // 月报
  // 填写月报
  postAddMonthReport(params) {
    return http.post(`${request}/addMonthReport`, params)
  },
  // 修改月报
  postUpdateMonthReport(params) {
    return http.post(`${request}/updateMonthReport`, params)
  },
  // 查看某人某月月报
  getPersonMonthReport(params) {
    return http.get(`${request}/getMonthReport`, params)
  },
  // 查看某组某月月报
  getMonthReportByGroup(params) {
    return http.get(`${request}/get/groupMonthReport`, params)
  },

  // 周报
  // 填写周报 /year/addWeek
  postAddWeekReport(params) {
    return http.post(`${request}/addWeek`, params)
  },
  // 修改周报 /year/updateWeek
  postUpdateWeekReport(params) {
    return http.post(`${request}/updateWeek`, params)
  },
  // 查看某人周报 /year/getWeek
  getPersonWeekReport(params) {
    return http.get(`${request}/getWeek`, params)
  },
  // 默认返回组内当前月的最近的一次周报 /year/get/groupWeek
  getWeekReportRecent(params) {
    return http.get(`${request}/get/groupWeek`, params)
  },
  // 默认本人返回当前月的所有周报  /year/getWeekAll
  getWeekReportThisMonth(params) {
    return http.get(`${request}/get/getWeekAll`, params)
  },
  // 填写毕业总结，reportType:4
  postGraduateReport(graduateReport) {
    return http.post(`${request}/addGraduateReport`, graduateReport);
  },
  // 修改毕业总结
  updateGraduateReport(graduateReport) {
    return http.post(`${request}/updateGraduateReport`, graduateReport);
  },
  // 查看某人毕业总结
  getSingleGraduateReport(userId) {
    return http.get(`${request}/getGraduateReport`, userId);
  },
  // 查看某组内的毕业总结
  getGroupGraduateReport(groupId) {
    return http.get(`${request}/get/groupGraduateReport`, groupId);
  },
  // year/get/groupThreeWeek 查询某组内所有人的最近三周的周报
  getGroupThreeWeek(params) {
    return http.get(`${request}/get/groupThreeWeek`, params);
  },
}

export default year
